import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import * as cors from 'cors'

function MiddlewareAll(req:any,res:any,next:any){
  console.log('已进入全局中间件');
  next()
}

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  app.use(cors)
  app.use(MiddlewareAll)
  
  await app.listen(3000);
  if (module.hot) {
    module.hot.accept();
    module.hot.dispose(() => app.close());
  }
}



bootstrap();
